Telegram Group & Telegram Channel
ℹ️ Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке

📌 Что делает решето Эратосфена

Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей.

➡️ Как это работает

▪️ Создаём массив от 2 до N

▪️ Берём первое невычеркнутое число p

▪️ Вычеркиваем все кратные p

▪️ Переходим к следующему невычеркнутому числу

▪️ Повторяем, пока p² <= N

Пример на Python:
def eratosthenes(n):
sieve = [True] * (n+1)
sieve[0:2] = [False, False]
for i in range(2, int(n**0.5) + 1):
if sieve[i]:
for j in range(i*i, n+1, i):
sieve[j] = False
return [i for i, prime in enumerate(sieve) if prime]


🔵 Чтобы знать об алгоритмах все, забирайте наш курс «Алгоритмы и структуры данных»

Proglib Academy #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/proglib_academy/2771
Create:
Last Update:

ℹ️ Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке

📌 Что делает решето Эратосфена

Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей.

➡️ Как это работает

▪️ Создаём массив от 2 до N

▪️ Берём первое невычеркнутое число p

▪️ Вычеркиваем все кратные p

▪️ Переходим к следующему невычеркнутому числу

▪️ Повторяем, пока p² <= N

Пример на Python:

def eratosthenes(n):
sieve = [True] * (n+1)
sieve[0:2] = [False, False]
for i in range(2, int(n**0.5) + 1):
if sieve[i]:
for j in range(i*i, n+1, i):
sieve[j] = False
return [i for i, prime in enumerate(sieve) if prime]


🔵 Чтобы знать об алгоритмах все, забирайте наш курс «Алгоритмы и структуры данных»

Proglib Academy #буст

BY Proglib.academy | IT-курсы




Share with your friend now:
tg-me.com/proglib_academy/2771

View MORE
Open in Telegram


Proglib academy | IT курсы Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

Proglib academy | IT курсы from id


Telegram Proglib.academy | IT-курсы
FROM USA